<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">

   <xsl:param name="name"    select="/.."/>
   <xsl:param name="version" select="/.."/>

   <xsl:variable name="src-base" select="
       concat('resource:org/expath/repo/', $name, '/', $version, '/')"/>

   <xsl:template match="node()">
      <xsl:copy>
         <xsl:copy-of select="@*"/>
         <xsl:apply-templates/>
      </xsl:copy>
   </xsl:template>

   <xsl:template match="
       builtin-modules/text()[
           following-sibling::node()[1][self::module][starts-with(@src, $src-base)]
         ]"/>
   <xsl:template match="builtin-modules/module[starts-with(@src, $src-base)]"/>

</xsl:stylesheet>
